package com.neusoft.yuejian_6.model;

import com.neusoft.yuejian_6.javabean.User;

import com.neusoft.yuejian_6.service.UserService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Mao on 2017/9/27.
 */
public class UserModel {
    private Retrofit retrofit;
    public UserModel(){
        retrofit = new Retrofit.Builder()
                //http://10.0.2.2/yuejian14/API/User/getUserLogin/
                //  http://172.24.10.175/workout/api.php/login/

                .baseUrl("http://10.0.2.2/neu1_yuejian/index.php/Api/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }
    public Call<User> login(String str_name, String str_upass){
        UserService userService = retrofit.create(UserService.class);
        return userService.getUserLogin(str_name,str_upass);
    }

    public Call<User> register(String str_name, String str_upass, String str_phone, String str_age,String str_sex) {
        UserService userService = retrofit.create(UserService.class);
        return userService.getuserRegister(str_name,str_upass,str_phone,str_age,str_sex);
    }


}
